package com.boot.service.impl;

import com.boot.entity.User;
import com.boot.mapper.UserDao;
import com.boot.service.TokenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;

@Service
public class TokenServiceImpl implements TokenService {

	@Resource
	private UserDao userDao;
	
	@Override
	public boolean checkToken(String user_id,String phone, String token) {
		HashMap<String, String> map=new HashMap<>();
		map.put("user_id",user_id);
		map.put("token",token);
		map.put("phone", phone);
		User user=userDao.getUserInfo(map);
		if(user!=null){
			return true;
		}
		return false;
	}

}
